MCQ Answer

The syntax of seek() is: file_object.seek(offset [, reference_point]) What does the reference_point indicate?

The syntax of seek() is: file_object.seek(offset [, reference_point]) What does the reference_point indicate?

seek () का सिंटैक्स है: file_object.seek(offset [, Reference_point]) रेफरेंस_पॉइंट क्या दर्शाता है?
Topic : File Processing in Python

A. reference_point indicates the current position of the file object

B. reference_point indicates the starting position of the file object

C. reference_point indicates the ending position of the file object

D. None of the above




Correct Answer is :

B. reference_point indicates the starting position of the file object



Explanation


In the seek() method of a file object in Python, the offset parameter is the number of bytes to move the file pointer, and the optional reference_point parameter indicates the reference point or the position from where the offset should be measured. The reference_point parameter is optional, and if not provided, it defaults to the beginning of the file (offsets are measured from the beginning).


The reference_point parameter can take one of the following values:


  • 0 (default): The offset is measured from the beginning of the file.
  • 1: The offset is measured from the current file position.
  • 2: The offset is measured from the end of the file.
CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz